<template>
  <div class="ad-list-container">
    <div class="buttons">
      <SwitchButton title="上云动态" :active="true" />
      <SwitchButton title="上云政策" />
    </div>
    <div class="img">
        <img :src="img" alt="">
        <div class="text">成都今年力争实现企业上云总量突破10万家</div>
    </div>
    <div class="ads">
        <div class="ad-item" v-for="(item, i) in adData" :key="i">{{ `${i+1}. ${item}` }} </div>
    </div>
  </div>
</template>

<script>
import SwitchButton from "./SwitchButton.vue";
import img from "@/assets/data/exports/image4@2x.png";
export default {
  components: {
    SwitchButton,
  },
  data() {
    return {
      img,
      adData: [
        '夯实数字新底座 助力经济乘“云”而上',
        '成都今年力争实现企业上云总量突破10万家',
        '成都“企业上云”重磅出击，“上云”专班全力助推云上企业破十万',
        '图文“企业上云”政策解读: 到底什么是企业上云？怎',
        '中国电信山东公司：上云用数赋智 助力工业数字',
      ]
    };
  },
};
</script>

<style lang="scss" scoped>
.ad-list-container {
  width: 28vw;
  height: fit-content;
  background: white;
  padding: 10px 20px 20px 20px;
  .buttons {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #eeeded;
  }
  .img {
    margin-top: 15px;
    width: 100%;
    position: relative;
    margin-bottom: 15px;
    img {
        width: 100%;
    }
    .text {
        width: 80%;
        height: 80%;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        justify-content: center;
        align-items: center;
        color: white;
        font-size: 20px;
        text-align: center;
    }
  }
  .ads {
    .ad-item {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 25px;
        &:last-child {
            margin-bottom: 10px;
        }
    }
  }
}
</style>
